home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / docs / misc / amigapl.9903.lzh / amigapl.9903 / pci.lzx / Include / libraries / pciexpansion.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-02  |  6.1 KB  |  137 lines

  1. #ifndef    LIBRARIES_PCIEXPANSION_H
  2. #define LIBRARIES_PCIEXPANSION_H
  3.  
  4. /*
  5. **    $VER: pciexpansion.h 1.0 (22.12.9)
  6. **
  7. **    pciexpansion.library include file
  8. **
  9. **    (C) Copyright 1997-1998 MicroniK
  10. **        All Rights Reserved
  11. **
  12. */
  13. #ifndef    EXEC_TYPES_H
  14. #include "exec/types.h"
  15. #endif
  16.  
  17. #include <libraries/configvars.h>
  18.  
  19. #define PCIEXPANSIONNAME    "pciexpansion.library"
  20.  
  21. /* pci card configuration header format */
  22. /* Can be accessed by ReadCfgReg (RW)   */
  23. /* or via pciexpansion.library   (RO)   */
  24. struct PCICfg {
  25.     struct pci_id {
  26.         ULONG    did     : 16;   /* Device ID.                          */
  27.         ULONG    vid     : 16;   /* Vendor ID. 0xFFFF - slot empty      */
  28.     }       pcie_id;
  29.     struct pci_cs {
  30.         ULONG    d_pe    :  1;   /* Detected Parity Error.              */
  31.         ULONG    s_serr  :  1;   /* Signaled SERR#.                     */
  32.         ULONG    r_ma    :  1;   /* Received Master-Abort.              */
  33.         ULONG    r_ta    :  1;   /* Received Target-Abort.              */
  34.         ULONG    s_ta    :  1;   /* Signaled Target-Abort.              */
  35.         ULONG    devsel  :  2;   /* DEVSEL timing.                      */
  36.         ULONG    dp_d    :  1;   /* Data Parity Detected.               */
  37.         ULONG    tfbbc   :  1;   /* Target Fast Back to Back Capable.   */
  38.         ULONG    udfs    :  1;   /* User Definable Features Support.    */
  39.         ULONG    dev66   :  1;   /* Device 66 MHz Capable.              */
  40.         ULONG    res1    :  5;   /*      PCI Reserved.                  */
  41.         ULONG    res2    :  6;   /*      PCI Reserved.                  */
  42.         ULONG    mfbbc   :  1;   /* Master Fast Back-to-Back Enable.    */
  43.         ULONG    serr_en :  1;   /* SERR# Enable.                       */
  44.         ULONG    step    :  1;   /* Data/address stepping.              */
  45.         ULONG    peresp  :  1;   /* Parity Error Response.              */
  46.         ULONG    vgaps   :  1;   /* VGA Palette Snoop.                  */
  47.         ULONG    mwi_en  :  1;   /* Memory Write and Invalidate Enable. */
  48.         ULONG    sca     :  1;   /* Special Cycles action.              */
  49.         ULONG    bm      :  1;   /* Bus Master.                         */
  50.         ULONG    ms      :  1;   /* Memory Space.                       */
  51.         ULONG    ios     :  1;   /* I/O Space.                          */
  52.     }       pcie_cs;
  53.     struct pci_class {
  54.         ULONG    base    :  8;   /* Base Class Code.                    */
  55.         ULONG    sub     :  8;   /* Sub Class Code.                     */
  56.         ULONG    prog    :  8;   /* Programming Interface.              */
  57.         ULONG    revid   :  8;   /* Revision ID.                        */
  58.     }       pcie_class;
  59.     struct pci_misc0 {
  60.         ULONG    bistc   :  1;   /* BIST Capable.                       */
  61.         ULONG    sbist   :  1;   /* Start BIST.                         */
  62.         ULONG    res1    :  2;   /*     PCI Reserved.                   */
  63.         ULONG    ccode   :  4;   /* Completion Code.                    */
  64.         ULONG    mfunct  :  1;   /* Multifunction Device.               */
  65.         ULONG    layout  :  7;   /* Configuration Space Layout.         */
  66.         ULONG    ltimer  :  5;   /* Latency Timer.                      */
  67.         ULONG    zero1   :  7;   /* Zeros.                              */
  68.         ULONG    cline   :  2;   /* CacheLine Size.                     */
  69.         ULONG    zero2   :  2;   /* Zeros.                              */
  70.     }       pcie_misc0;
  71.     union  pci_base_address {
  72.         struct pci_mem_addr {
  73.            ULONG   ba    : 28;   /* Base Address.                       */
  74.            ULONG   pref  :  1;   /* Prefetchable                        */
  75.            ULONG   type  :  2;   /* 00 - locate anywhere in 32bit space */
  76.                                  /* 01 - locate below 1MB               */
  77.                                  /* 10 - locate anywhare in 64bit space */
  78.                                  /* 11 - reserved                       */
  79.            ULONG   space :  1;   /* PCI Bus Address Space.              */
  80.                                  /* 0 - memory space                    */
  81.         } pcie_mem_addr;
  82.         struct pci_io_addr {
  83.            ULONG   ba    : 30;   /* Base Address.                       */
  84.            ULONG   zero1 :  1;   /* Zeros.                              */
  85.            ULONG   space :  1;   /* PCI Bus Address Space.              */
  86.                                  /* 1 - IO space                        */
  87.         } pcie_io_addr;
  88.         ULONG      valUlong;     /* if you prefer to mask bits          */
  89.     }       pcie_baddr[6];             /* up to 6 adres registers */
  90.     ULONG   pcie_CISptr;         /* Cardbus CIS pointer                 */
  91.     struct pci_sid {
  92.         ULONG    sid     : 16;   /* Subsystem ID.                       */
  93.         ULONG    svid    : 16;   /* Subsystem Vendor ID.                */
  94.     }       pcie_sid;
  95.     union pci_rom_addr {
  96.         struct {
  97.             ULONG  ba    : 21;   /* Base Address.                       */
  98.             ULONG  zero1 : 10;   /* Zeros.                              */
  99.             ULONG  ena   :  1;   /* ROM enable                          */
  100.         } bits;
  101.         ULONG valUlong;
  102.     }       pcie_rom_addr;
  103.     ULONG   pci_Reserved1;
  104.     ULONG   pci_Reserved2;
  105.     struct pci_misc1 {
  106.         ULONG    max_lat     :  8;   /* Maximum Latency.                    */
  107.         ULONG    min_gnt     :  8;   /* Minimum Grant.                      */
  108.         ULONG    int_pin     :  8;   /* Interrupt Pin.                      */
  109.         ULONG    int_line    :  8;   /* Interrupt Line.                     */
  110.     }       pcie_misc1;
  111. };
  112.  
  113.  
  114. struct  PCIConfDev {
  115.     struct Node DevNode;
  116.     struct PCICfg Config;
  117.     struct ConfigDev * ExpansionDev;
  118.     struct PCIExpDev * next; 
  119.     UBYTE  SlotNo;
  120.     UBYTE  Size[7];     /* 6 base addresses and rom size */
  121. };
  122.  
  123. /*
  124. ** TAGS to FindPCIDev 
  125. ** used to select PCI cards
  126. */
  127. #define PCIE_TAGBASE        0xABCD0000
  128. #define PCIE_CONFIGDEV      (PCIE_TAGBASE+1)
  129. #define PCIE_VENDORID       (PCIE_TAGBASE+2)
  130. #define PCIE_DEVICEID       (PCIE_TAGBASE+3)
  131. #define PCIE_BASECLASSCODE  (PCIE_TAGBASE+4)
  132.  
  133.  
  134. #endif    /* LIBRARIES_PCIEXPANSION_H */
  135.  
  136.  
  137.